package library.RemoteControl;

/**
 * The Interface_RemoteControl declares the interface to be visible when
 * defining a remote control. <br/>
 * For the time being, there is 2 kinds of remote controls : <br/>
 * <ul>
 * <li> a remote control that controls a frame : will be used with a graphical Java application or an applet </li>
 * <li> a void remote control that do nothing : will be used with a Command Line instruction (no graphical capabilities) </li>
 * </ul>
 * When those methods command graphical components update, they should be 
 * executed in the EDT thread, and then invoked through SwingUtilities.InvokeLater.<br/>
 * @author JNC
 */
public interface RemoteControlInterface {

    /**
     * Registers an object in order to let objects interact together through 
     * the remote control.
     * @param myObject
     * Object to register
     * @throws RemoteControl.Exception_UnknownClassException
     * Exception thrown when the class of the object to register is unknown
     */
    public void register(Object myObject) throws UnknownClassException;
    
    /**
     * Unregisters an object from the remote control.
     * @param myObject
     * Object to unregister
     * @throws RemoteControl.Exception_UnknownClassException
     * Exception thrown when the class of the object to unregister is unknown
     */
    public void unregister(Object myObject) throws UnknownClassException;
    
    /**
     * Enables / disables all the commands of the frame.
     * @param myMustBeEnabled
     * Indicates whether the commands must be enabled (true) or disabled (false)
     */
    public void enableCommands(boolean myMustBeEnabled);
    
    /**
     * Starts the progress bar in indeterminate mode.
     */
    public void startIndeterminateProgressBar();
    
    /**
     * Stops the progress bar from determinate mode.
     */
    public void stopIndeterminateProgressBar();
    
    /**
     * Initializes the progress bar for determinate mode.
     */
    public void initDeterminateProgressBar();
    
    /** 
     * Sets a progress to the progress bar.
     * @param myProgress
     * Integer from 0 to 100 showing the current progress
     */
    public void setDeterminateProgressBar(int myProgress);
    
    /**
     * Stops the progress bar from indeterminate mode.
     */    
    public void stopDeterminateProgressBar();
    
    /**
     * Reinits the progress bar
     */
    public void reinitProgressBar();
    
    /**
     * Sets all labels referencing a given jpeg file and request the picture to
     * be displayed.
     * @param myNameBefore
     * The name of the file before renaming
     * @param myDigitalizationDate
     * The digitalization date of the file as read in the jpeg EXIF metadata
     * @param myTitle
     * The title of the file as read in the jpeg EXIF metadata
     * @param myNameAfter
     * The name of the file after renaming
     * @param mysPicturePath
     * The path of the jpeg file being processed
     */
    public void setLabelsAndShowPicture(String myNameBefore, String myDigitalizationDate, String myTitle, String myNameAfter, String mysPicturePath);
   
    /**
     * Sets the text of the GO/CANCEL button to GO and activates the button.
     */
    public void reinitGoCancelButton();
    
    /**
     * Activates/desactivates the GO/CANCEL button.
     * @param myActivation
     * Indicates if the button must be activated (true) or desactivated (false)
     */
    public void activateGoCancelButton(boolean myActivation);
    
    /**
     * Requests the processing thread to stop.
     */
    public void requestProcessingThreadToStop(); 
    
    /**
     * Asks if the processing thread is still alive.
     * This test is not necessary when running an application (all non-daemon already
     * started thread go on running even if the frame is closed)
     * However, for applets, all runing threads are stopped at the end of the 
     * stop() method of the applet. In this case, it is necessary to delay 
     * the end of the stop() method up to the effective death of the thread
     * @return
     * true if alive, false otherwise
     */
    public boolean isProcessingThreadAlive();
    
    /**
     * Disables the auto scroll down capability of the jTextArea
     * true to enable scroll down
     * false to disable scroll down
     */
    public void disableAutoScrollDownTemporary();
    
    /**
     * Change the border of the text area when the auto scroll down is enbaled / disabled
     * @param isTransient
     */
    public void changeBorderToTransient(boolean isTransient);
}
